euclid division algorithm for negative integers